home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dvi2xx / MakeTeXPK < prev    next >
Text File  |  1994-04-24  |  3KB  |  110 lines

  1. #!/bin/sh
  2. #
  3. #   This script file makes a new TeX PK font, because one wasn't
  4. #   found.  Parameters are:
  5. #
  6. #   name dpi bdpi magnification [mode]
  7. #
  8. #   `name' is the name of the font, such as `cmr10'.  `dpi' is
  9. #   the resolution the font is needed at.  `bdpi' is the base
  10. #   resolution, useful for figuring out the mode to make the font
  11. #   in.  `magnification' is a string to pass to MF as the
  12. #   magnification.  `mode', if supplied, is the mode to use.
  13. #
  14. #   Note that this file must execute Metafont, and then gftopk,
  15. #   and place the result in the correct location for the PostScript
  16. #   driver to find it subsequently.  If this doesn't work, it will
  17. #   be evident because MF will be invoked over and over again.
  18. #
  19. #   Of course, it needs to be set up for your site.
  20. #
  21. # TEMPDIR needs to be unique for each process because of the possibility
  22. # of simultaneous processes running this script.
  23.  
  24. DESTDIR=/usr/local/lib/tex/pk/pk300
  25. MFINPUTS=`pwd`:/usr/local/lib/mf/inputs
  26. export MFINPUTS
  27. TEMPDIR=/usr/tmp/mtpk.$$
  28. # MF=mf
  29. MF=cmmf
  30. #################### END OF Configuration
  31.  
  32. NAME=$1
  33. DPI=$2
  34. BDPI=$3
  35. MAG=$4
  36. MODE=$5
  37.  
  38. umask 0
  39.  
  40. if test "$MODE" = ""
  41. then
  42.    if test $BDPI = 300
  43.    then
  44.       MODE=imagen
  45.    elif test $BDPI = 400
  46.    then
  47.       MODE=nexthi
  48.    elif test $BDPI = 100
  49.    then
  50.       MODE=nextscreen
  51.    elif test $BDPI = 635
  52.    then
  53.       MODE=linolo
  54.    elif test $BDPI = 1270
  55.    then
  56.       MODE=linohi
  57.    elif test $BDPI = 2540
  58.    then
  59.       MODE=linosuper
  60.    else
  61.       echo "I don't know the mode for $BDPI"
  62.       echo "Have your system admin update MakeTeXPK"
  63.       exit 1
  64.    fi
  65. fi
  66.  
  67. #  Something like the following is useful at some sites.
  68. # DESTDIR=/usr/local/lib/tex/fonts/pk.$MODE
  69. GFNAME=./$NAME.$DPI'gf'
  70. PKNAME=./$NAME.$DPI'pk'
  71.  
  72. # Clean up on normal or abnormal exit
  73. trap "cd /; rm -rf $TEMPDIR $DESTDIR/pktmp.$$" 0 1 2 15
  74.  
  75. mkdir $TEMPDIR
  76. cd $TEMPDIR
  77.  
  78. if test -r $DESTDIR/$PKNAME
  79. then
  80.    echo "$DESTDIR/$PKNAME already exists!"
  81.    exit 0
  82. fi
  83.  
  84. # check also in the standard place
  85.  
  86. if test -r /usr/lib/tex/fonts/pk/$PKNAME
  87. then
  88.    echo /usr/lib/tex/fonts/pk/$PKNAME already exists!
  89.    exit 0
  90. fi
  91.  
  92. echo $MF "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" \\\</dev/null
  93. $MF "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" </dev/null
  94. if test ! -r $GFNAME
  95. then
  96.    echo "Metafont failed for some reason on $GFNAME"
  97.    exit 1
  98. fi
  99.  
  100. gftopk $GFNAME $PKNAME
  101.  
  102. # Install the PK file carefully, since others may be doing the same
  103. # as us simultaneously.
  104.  
  105. mv $PKNAME $DESTDIR/pktmp.$$
  106. cd $DESTDIR
  107. mv pktmp.$$ $PKNAME
  108.  
  109. exit 0
  110.